

Public Class frmTextEntry

    Private _cancelled As Boolean = False

    ReadOnly Property Cancelled() As Boolean
        Get
            Return _cancelled
        End Get
    End Property

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Me.Hide()
    End Sub

    Private Sub txtInputText_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtInputText.KeyUp
        If e.KeyCode = Keys.Enter Then Me.Hide()
    End Sub

    Public Property HeaderText() As String
        Get
            Return lblHeader.Text
        End Get
        Set(ByVal value As String)
            lblHeader.Text = value
        End Set
    End Property

    Public Property InputText() As String
        Get
            Return txtInputText.Text
        End Get
        Set(ByVal value As String)
            txtInputText.Text = value
        End Set
    End Property

    Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        _cancelled = True
        Me.Hide()
    End Sub
End Class